package com.qch.es.util;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @Author qch
 * @Date 2021/7/1
 */
public class DBHelper {
    public static final String url = "jdbc:mysql://**/lagou_position? useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai";
    public static final String name = "com.mysql.jdbc.Driver";
    public static final String user = "**";
    public static final String password = "**";
    public static Connection conn = null;

    public static Connection getConn() {
        try {
            Class.forName(name);
            conn = DriverManager.getConnection(url, user, password);
            //获取连接
        } catch (Exception e) {
            e.printStackTrace();
        }
        return conn;
    }
}
